class User < ApplicationRecord
	validates :password, length: {in: 8..20}
	before_save {self.email = email.downcase}
	validates :username, presence:true, length: {in: 6..20}
	validates :email, presence:true, length: {in: 5..255}, format: {with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i}, uniqueness:{case_sensitive: false}
	has_secure_password
end
